﻿#ifndef THREADSHOWDISCSONWIN_H
#define THREADSHOWDISCSONWIN_H
#include <Windows.h>
#include <QThread>
#include <QHash>
#include <QMutex>
#include <QMutexLocker>
#include "ThreadShowDiscsOnWin_global.h"

class THREADSHOWDISCSONWIN_EXPORT ThreadShowDiscsOnWin : public QThread {
Q_OBJECT;
	// 信息映射
	QHash<QString, QHash<QString, ULARGE_INTEGER>> discInfo;
	char* buff = Q_NULLPTR;
	const int maxBuffLen = 4096;
	QMutex* statsMutex = Q_NULLPTR;
	void getDiscInfo(QVector<char*>& chars);
	int runStats(int status = 0);
public:
	QHash<QString, QHash<QString, ULARGE_INTEGER>> getDiscInfo( ) const {
		return discInfo;
	}

	ThreadShowDiscsOnWin(QObject* parent = Q_NULLPTR);
	virtual ~ThreadShowDiscsOnWin( );

protected:
	void run( ) override;
signals:
	void sendDiscInfo(QHash<QString, QHash<QString, ULARGE_INTEGER>>* discInfo);
};
#endif // THREADSHOWDISCSONWIN_H
